//
//  CinemaTVCell.m
//  豆瓣
//
//  Created by lanou3g on 15/12/9.
//  Copyright © 2015年 HaiTeng. All rights reserved.
//

#import "CinemaTVCell.h"

@interface CinemaTVCell ()

@property(nonatomic,strong)UIImageView *backView; //背景视图


@end






@implementation CinemaTVCell



//重写Model 的set方法 赋值
- (void)setModel:(CinemaModel *)model
{
    
    if (model) {
        _cinemaNameLabel.text = model.cinemaName;
        _addressLabel.text = model.address;
        _telephoneLabel.text = model.telephone;
        
    }
    
}






- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self addAllViews];
        
    }
    
    
    return self;
    
}

- (void)addAllViews
{
    

  
    self.backView = [[UIImageView alloc] init];
    self.backView.image = [UIImage imageNamed:@"bg_eventlistcell"];
    [self.contentView addSubview:_backView];
    
    //影院名字
    self.cinemaNameLabel = [[UILabel alloc] init];
    self.cinemaNameLabel.font = [UIFont systemFontOfSize:20];
    [_backView addSubview:self.cinemaNameLabel];
    
    //影院地址
    self.addressLabel = [[UILabel alloc] init];
    self.addressLabel.numberOfLines = 0;
//    self.addressLabel.frame = CGRectMake(5, 50, self.bounds.size.width - 10, 30);
    self.addressLabel.font = [UIFont systemFontOfSize:14];
  
    [_backView addSubview:self.addressLabel];
    
    //影院电话
    self.telephoneLabel = [[UILabel alloc] init];
     self.telephoneLabel.font = [UIFont systemFontOfSize:14];
    [_backView addSubview:self.telephoneLabel];
    
    
    
    
    
    
}


- (void)layoutSubviews
{

    [super layoutSubviews];
    _backView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);

    //影院名字
    self.cinemaNameLabel.frame = CGRectMake(5, 5, self.backView.bounds.size.width - 10, 40);
    
    
    
    
    //影院电话
    self.telephoneLabel.frame = CGRectMake(5, 78, self.backView.bounds.size.width - 10, 30);
}








- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
